feat(linux-sandbox): add bwrap support#9938
Merged
viyatb-oai merged 16 commits intomainfrom Feb 4, 2026
Merged
Conversation
3903ff5 to
5aa61a1
Compare
Contributor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5aa61a15ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
5aa61a1 to
2e968d3
Compare
4d27a26 to
0198203
Compare
3a4a6ed to
077419b
Compare
a7b4ed5 to
669ccb9
Compare
viyatb-oai
added a commit
that referenced
this pull request
Feb 3, 2026
## Summary Vendor Bubblewrap into the repo and add minimal build plumbing in `codex-linux-sandbox` to compile/link it. ## Why We want to move Linux sandboxing toward Bubblewrap, but in a safe two-step rollout: 1) vendoring/build setup (this PR), 2) runtime integration (follow-up PR). ## Included - Add `codex-rs/vendor/bubblewrap` sources. - Add build-time FFI path in `codex-rs/linux-sandbox`. - Update `build.rs` rerun tracking for vendored files. - Small vendored compile warning fix (`sockaddr_nl` full init). follow up in #9938
669ccb9 to
1ae8d7f
Compare
viyatb-oai
commented
Feb 3, 2026
bolinfest
reviewed
Feb 3, 2026
bolinfest
reviewed
Feb 3, 2026
|
|
||
| /// Execute the build-time bubblewrap `main` function with the given argv. | ||
| pub(crate) fn exec_vendored_bwrap(argv: Vec<String>) -> ! { | ||
| let exit_code = run_vendored_bwrap_main(&argv); |
Collaborator
There was a problem hiding this comment.
Hmm, so this appears to be the end of main():
where:
if (execvp (exec_path, argv) == -1)
leads to:
die_with_error ("execvp %s", exec_path);
but if execvp() does not return -1, then bwrap's main returns 0, even though that suggests something has gone horribly wrong?
bolinfest
reviewed
Feb 3, 2026
Collaborator
bolinfest
left a comment
There was a problem hiding this comment.
OK, a handful of questions/clarifications!
bolinfest
reviewed
Feb 4, 2026
bolinfest
reviewed
Feb 4, 2026
bolinfest
reviewed
Feb 4, 2026
bolinfest
reviewed
Feb 4, 2026
bolinfest
reviewed
Feb 4, 2026
bolinfest
reviewed
Feb 4, 2026
bolinfest
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a gated Bubblewrap (bwrap) Linux sandbox path. The curent Linux sandbox path relies on in-process restrictions (including Landlock). Bubblewrap gives us a more uniform filesystem isolation model, especially explicit writable roots with the option to make some directories read-only and granular network controls.
This is behind a feature flag so we can validate behavior safely before making it the default.
features.use_linux_sandbox_bwrap